<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS 转换过渡 transition</title>
    <style>
        html, body {
            height: 100%;
        }
        body {
            display: flex;
            justify-content: flex-start;
            flex-direction: column;
        }
        .box {
            color: aliceblue;
            display: flex;
            justify-content: center;
            align-items: center;

            width: 100px;
            height: 100px;
            margin-bottom: 1rem;
            background-color:blueviolet;
        }


        .box:first-child:hover {
            width: 200px;
        }
        .box:first-child {
            transition: width 2s;
        }

        .box:nth-child(2) {
            transition: width 2s, height 4s, background-color 0.5s;
        }
        .box:nth-child(2):hover {
            background-color: rgb(63, 159, 243);
            width: 150px;
            height: 150px;
        }

        .box:nth-child(3) {
            transition: width 2s;
            transition-timing-function: linear;
        }
        .box:nth-child(3):hover {
            width: 300px;
        }

        .box:nth-child(4) {
            transition: width 2s;
            transition-timing-function: ease;
        }
        .box:nth-child(4):hover {
            width: 300px;
        }

        .box:nth-child(5) {
            transition: width 2s;
            transition-timing-function: ease-in;
        }
        .box:nth-child(5):hover {
            width: 300px;
        }

        .box:nth-child(6) {
            transition: width 2s;
            transition-timing-function: ease-out;
        }
        .box:nth-child(6):hover {
            width: 300px;
        }

    </style>
</head>
<body>
    <div class="box">w</div>
    <div class="box">w + h</div>
    <div class="box">linear</div>
    <div class="box">ease</div>
    <div class="box">ease-in</div>
    <div class="box">ease-out</div>

    <a href="https://cubic-bezier.com/" target="_blank">timing function</a>
</body>
</html>
